﻿@using SimpleMemberShip.Models
@using SelectListItem = System.Web.Mvc.SelectListItem
@model Register
@{
    ViewBag.Title = "Register";
    List<SelectListItem> roles = new List<SelectListItem>() 
    {
        new SelectListItem()
        {
            Text="admin",
            Value="admin"
        },
        new SelectListItem()
        {
            Text="member",
            Value="member"
        },
        new SelectListItem()
        {
            Text="user",
            Value="user"
        }
    };
}

<h2>Enter Your Cresdential</h2>
<div>
    @using (@Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary()
        <label>Enter UserName </label>
        @Html.TextBoxFor(x => x.Username, new { @class = "form-control" })
        <label>Enter Password </label>
        @Html.PasswordFor(x => x.Password, new { @class = "form-control" })
        <label>Role </label>
        @Html.DropDownList("role",roles,"Select role")
       @*@Html.DropDownList("Roles", new List<SelectListItem> 
          {
           new SelectListItem{Text="admin",Value="admin",Selected=true},
           new SelectListItem{Text="member",Value="member"},
           new SelectListItem{Text="user",Value="user"}
          },"Select roles")*@
       @*@Html.DropDownListFor(n=>n.Username, new SelectList(roles,"Text","Value"))*@
        <br />
        <button class="btn btn-primary">Create</button>
       
    }
</div>

